#!/usr/bin/env bash

# Test that quiet directive is respected in nested task calls
# even when parent task has multiple dependencies (which triggers prefix mode)

cat <<EOF >mise.toml
[tasks.dep1]
run = 'echo dep1'

[tasks.dep2]
run = 'echo dep2'

[tasks."child:quiet"]
quiet = true
run = 'echo child output'

[tasks.parent]
depends = ['dep1', 'dep2']
run = 'mise run child:quiet'
EOF

# When parent has multiple deps, it would previously export MISE_TASK_OUTPUT=prefix
# which would override the child task's quiet=true setting
# After the fix, the child task should respect its quiet directive
# Note: dep1 and dep2 run in parallel so their order is non-deterministic
assert_contains "mise run parent" "[dep1] dep1"
assert_contains "mise run parent" "[dep2] dep2"
assert_contains "mise run parent" "[parent] child output"
